package fr.babos.graphic.components.base 
{
	import fr.babos.graphic.components.base.ResizableComponent;
	
	/**
	 * @author ZoulouX
	 */
	public class BorderContainer extends ResizableComponent 
	{
		protected var _borderColor				:uint;
		protected var _borderWidth				:Number;
		
		public function BorderContainer (pBorderColor:uint = 0x000000, pBorderWidth:Number = 1)
		{
			_borderColor = pBorderColor;
			_borderWidth = pBorderWidth;
		}
		
		override protected function resized ():void
		{
			graphics.clear();
			
			if (_localWidth > 0 && _localHeight > 0 && _borderWidth > 0)
			{
				graphics.lineStyle(_borderWidth, _borderColor);
				graphics.drawRect(0, 0, _localWidth, _localHeight);
			}
			
			super.resized();
		}
	}
}